package com.info33.platform.system.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.info33.platform.common.mvc.controller.BaseController;
import com.info33.platform.common.mvc.vo.Result;
import com.info33.platform.system.entity.SysMenu;
import com.info33.platform.system.service.SysMenuService;
import com.info33.platform.system.vo.SysMenuVO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @author admin
 */
@RestController
@RequestMapping("/SysMenu")
@Api(tags = "系统 - 菜单")
public class SysMenuController extends BaseController<SysMenuService, SysMenu> {

    private final SysMenuService sysMenuService;

    @Autowired
    public SysMenuController(SysMenuService sysMenuService) {
        super(sysMenuService);
        this.sysMenuService = sysMenuService;
    }
    
    @GetMapping(value = "/getMenuTree")
    @ApiOperation(value = "获取菜单树")
    public Result<List<SysMenuVO>> getMenuTree() {
        return Result.ok(sysMenuService.getMenuTree(getTenantId(),0));
    }

}